<%@ page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<h3><bean:message key="room.list.title"/></h3>
<html:form action="roomListing" method="POST">
	<c:forEach var="room" items="${rooms}">
		<a href="roomDelete.do?id=${room.id}">
			<button type="button" class="btn btn-xs btn-danger">
				<bean:message key="room.list.delete"/>
		</button></a>

		<c:if test="${room.name != null}">
			<a href="roomDismisstion.do?id=${room.id}">
				<button type="button" class="btn btn-xs btn-warning">
					<bean:message key="room.dismiss"/>
			</button></a>
		</c:if>

		${room.id}:${room.roomClass}:${room.beds} - ${room.name} ${room.surname}(${room.userID})
		<br/>
	</c:forEach>     
</html:form>

<html:messages id="msg" message="true" property="roomadd_success">
	<div class="alert alert-success">
		<bean:write name="msg"/>
	</div>
</html:messages>
<br/>

<a href="newRoom.jsp">
		<button type="button" class="btn btn-success" onclick="submit"><bean:message key="room.list.new"/></button>
</a>